package beans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.beans.VetoableChangeListener;
import java.beans.VetoableChangeSupport;
import java.io.Serializable;

public class Note implements Serializable {

	private static final long serialVersionUID = 7676456571758120365L;
	
	private Etudiant unEtudiant;
	private Examen unExamen;
	private int uneNote;
	
	public Note() {}
	
	public Note(Etudiant unEtudiant, Examen unExamen, int uneNote) {
		super();
		this.unEtudiant = unEtudiant;
		this.unExamen = unExamen;
		this.uneNote = uneNote;
	}

	public Etudiant getUnEtudiant() {
		return unEtudiant;
	}

	public void setUnEtudiant(Etudiant unEtudiant) {
		this.unEtudiant = unEtudiant;
	}

	public Examen getUnExamen() {
		return unExamen;
	}

	public void setUnExamen(Examen unExamen) {
		this.unExamen = unExamen;
	}

	public int getUneNote() {
		return uneNote;
	}

	public void setUneNote(int uneNote) {
		this.uneNote = uneNote;
	}

	PropertyChangeSupport changeSupport;
	VetoableChangeSupport vetoableSupport;
	
	public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.addPropertyChangeListener(listener);
	}
	
	public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.removePropertyChangeListener(listener);
	}
	
	public synchronized void addVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.addVetoableChangeListener(listener);
	}
	
	public synchronized void removeVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.removeVetoableChangeListener(listener);
	}
}
